package com.dyw;


import com.dyw.ba02.SomeServiceImpl;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * @auther Devil
 * @create 2022-01-07-14:14
 */
public class MyTest04 {
    @Test
    public void test04() {
        String config = "applicationContext05.xml";
        ApplicationContext ac = new ClassPathXmlApplicationContext(config);
        SomeServiceImpl proxy = (SomeServiceImpl) ac.getBean("someService");
        proxy.doSome("12", 12);
        /**
         * 目标类没有接口,使用cglib动态代理,spring会自动应用cglib
         * com.dyw.ba02.SomeServiceImpl$$EnhancerBySpringCGLIB$$16733491
         */
        System.out.println(proxy.getClass().getName());
    }
}
